package models

import (
	"gorm.io/driver/mysql"
	"gorm.io/gorm"
)

type Mv struct {
	Id   int    `json:"id"`
	Bt   string `json:"bt"`
	Jj   string `json:"jj"`
	Img  string `json:"img"`
	Time string `json:"time"`
	Zz   string `json:"zz"`
}

var DB *gorm.DB

func init() {
	var err error
	dsn := "root:root@tcp(127.0.0.1:3306)/day8"
	DB, err = gorm.Open(mysql.Open(dsn))
	if err != nil {
		panic(err)
	}
	DB.AutoMigrate(&Mv{})
}
